

;-----> Copy the gbuf to the screen and clear graph buffer (fast)
;Input: nothing
;Output:graph buffer is copied to the screen and subsequently cleared
ionfastCopy:
 di
 ld a,$80
 out ($10),a
 ld hl,plotsscreen-12-(-(12*64)+1)
 ld a,$20
 ld c,a
 inc hl
 dec hl
fastCopyAgain:
 ld b,64
 inc c
 ld de,-(12*64)+1
 out ($10),a
 add hl,de
 ld de,12
fastCopyLoop:
 add hl,de
 nop
 ret z
 ld a,(hl)
 ld (hl),0    ; clears the graph buffer at the same time
 out ($11),a
 ret z
 djnz fastCopyLoop
 ld a,c
 cp $2B+1
 jr nz,fastCopyAgain
 ret

fastCopyWithoutClear:
 di
 ld a,$80
 out ($10),a
 ld hl,plotsscreen-12-(-(12*64)+1)
 ld a,$20
 ld c,a
 inc hl
 dec hl
fastCopyAgain1:
 ld b,64
 inc c
 ld de,-(12*64)+1
 out ($10),a
 add hl,de
 ld de,12
fastCopyLoop1:
 add hl,de
 nop
 ret z
 ld a,(hl)
 out ($11),a
 ret z
 djnz fastCopyLoop1
 ld a,c
 cp $2B+1
 jr nz,fastCopyAgain1
 ei
 ret


 
